/************************************************************
 *                                                          *
 * Copyright (c) 2001-2012 McObject LLC. All Right Reserved.*
 *                                                          *
 ************************************************************/

#ifndef _MCO_EWS_TRANSPORT_LAYER_TCPIP_H
#define _MCO_EWS_TRANSPORT_LAYER_TCPIP_H

#include <mcowscfg.h>

#ifdef MCO_TRANSPORT_LAYER_TCPIP
#ifdef _INTEGRITY
#include <INTEGRITY.h>
#endif
#ifdef WIN32
#include <winsock2.h>		
#else /* WIN32 */
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifndef _VXWORKS
#include <sys/time.h>
#endif //_VXWORKS
#endif /* WIN32 */
#endif /* MCO_TRANSPORT_LAYER_TCPIP */

/*
 *
 * Transport Layer
 *
 */
typedef struct tag_mcohs_tlc_addr {
#ifdef MCO_TRANSPORT_LAYER_TCPIP
	struct in_addr addr;
	int            port;
#endif
} mcohs_tlc_addr_t,
 *mcohs_tlc_addr_h;

/*
 *
 * Buffered Transport Layer 
 *
 */
#ifdef MCO_HTTP_BUFFERED_CONNECTIONS

#if defined(MCO_SECURITY_MATRIXSSL)
typedef struct tag_mcohs_tlcs_init {
	char* cert;      // certificate
	int   cert_sz;   // size of the certificate
	char* priv;      // private key
	int   priv_sz;   // size of the private key
	char* priv_pass; // password of the private key
} mcohs_tlcs_init_t, *mcohs_tlcs_init_h;
#else  /* MCO_SECURITY_MATRIXSSL */
typedef void * mcohs_tlcs_init_t;
typedef mcohs_tlcs_init_t* mcohs_tlcs_init_h;
#endif /* MCO_SECURITY_MATRIXSSL */

#endif /* MCO_HTTP_BUFFERED_CONNECTIONS */

#endif /* _MCO_EWS_TRANSPORT_LAYER_TCPIP_H */
